package cn.zlp.hrm.doc;

/**
 * 针对于  Employee 表的文档映射
 *  indexName：索引库
 *  type：类型(表类型)
 * @program: hrm-parent
 * @author: Mr.Zhang
 * @create: 2022-01-08 21:31
 **/

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

// @Document(indexName = "hrm" , type = "employee")
public class EmployeeDoc {
    @Id
    private Long id;
    @Field(type = FieldType.Keyword) // 不分词文本
    private String name;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word") // 分词,即分词器
    private String intro;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    @Override
    public String toString() {
        return "EmployeeDoc{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", intro='" + intro + '\'' +
                '}';
    }
}
